// 全局的getters, 导出后挂载到index.js中,为了读取方便
const getters = {
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  token: state => state.user.token, // 挂载token到getters中
  name: state => state.user.userInfo.username,
  staffPhoto: state => state.user.userInfo.staffPhoto,
  routes: state => state.permission.routes,
  roles: state => state.user.userInfo.roles,
  themeColor: state => state.settings.theme
  // 因为user模块清空了, 这个还去读取读取不到
  // token: state => state.user.token,
  // avatar: state => state.user.avatar,
  // name: state => state.user.name
  /* name : function (state) {
     return state.user.name
  } */
}
export default getters
